/**
 * Created by Sergey Kharlamov.
 * Date: Nov 20, 2005
 * Time: 6:15:43 AM
 */
package univer.oko.gui.table;

import javax.swing.*;
import javax.swing.border.BevelBorder;
import javax.swing.border.Border;
import javax.swing.table.TableCellRenderer;
import java.awt.*;

public class TCellRenderer extends JLabel implements TableCellRenderer {
    private static Border headerBorder;
    private static Color background;
    private static Color foreground;

    public TCellRenderer() {
        super();
        if (headerBorder == null) {
            headerBorder = new BevelBorder(BevelBorder.RAISED);
            background = Color.DARK_GRAY;
            foreground = Color.ORANGE;
        }
        setBorder(headerBorder);
    }


    public Component getTableCellRendererComponent(JTable table, Object value,
                                                   boolean isSelected, boolean hasFocus,
                                                   int row, int column) {

        this.setForeground(Color.ORANGE);
        this.setBackground(Color.GREEN);
        setFont(table.getFont());

        setText((value == null) ? "" : value.toString());
        setBorder(headerBorder);
        return this;
    }
}



